﻿@using Chapter3Applications.Models.ViewModels
@model Chapter3Applications.Models.ViewModels.EnterShoppingListViewModel

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>EnterShoppingList</title>
</head>
<body>
    <div>
        @if (TempData["shoppingListName"] != null)
        {
             <p>ShoppingList @TempData["shoppingListName"] Entered</p>
        }
    </div>
    <div>
        @using (Html.BeginForm())
        {
            @Html.ValidationSummary()
            <p>ShoppingList to enter: @Html.TextBoxFor(x => x.ShoppingListName)</p>
            <p>Products to add to ShoppingList: </p>            
            
            foreach(KeyValuePair<String, Boolean> myProduct in Model.Products)
            {
                <p>
                @Html.CheckBoxFor(x => x.Products[myProduct.Key])
                @Html.Label(myProduct.Key)
                </p>
            }
            
            <input type="submit" value="Enter ShoppingList">
        }    
    </div>
</body>
</html>
